using System;

namespace LDNS.Models
{
    /// <summary>
    /// DNS记录模型
    /// 作者：huobing
    /// </summary>
    public class DnsRecord
    {
        /// <summary>
        /// 域名
        /// </summary>
        public string Domain { get; set; } = string.Empty;
        
        /// <summary>
        /// IP地址
        /// </summary>
        public string IP { get; set; } = string.Empty;
        
        /// <summary>
        /// 记录类型（A、AAAA、CNAME、MX、TXT等）
        /// </summary>
        public string RecordType { get; set; } = "A";
        
        /// <summary>
        /// 生存时间（秒）
        /// </summary>
        public int Ttl { get; set; } = 3600;
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; } = DateTime.Now;
        
        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime UpdatedTime { get; set; } = DateTime.Now;
        
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;
        
        /// <summary>
        /// 记录描述
        /// </summary>
        public string Description { get; set; } = string.Empty;
        
        /// <summary>
        /// 键（用于字典操作）
        /// </summary>
        public string Key => $"{Domain}:{RecordType}";
        
        /// <summary>
        /// 值（用于字典操作）
        /// </summary>
        public string Value => IP;
    }
}